home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c++,comp.lang.c,comp.os.ms-windows.programmer.misc
- Subject: Re: fastest code
- Date: 10 Apr 1996 08:05:23 -0500
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4kgbmj$j3j@solutions.solon.com>
- References: <316112A2.7D37@public.sta.net.cn> <4k4ll5$fq@solutions.solon.com> <4ke5v6$17k@samba.rahul.net> <1996Apr10.110121.6784@friend.kastle.com>
- Reply-To: seebs@solon.com
- NNTP-Posting-Host: solutions.solon.com
-
- In article <1996Apr10.110121.6784@friend.kastle.com>,
- Richard Krehbiel <rich@kastle.com> wrote:
- >Oliver Hellwig <hellwig@rahul.net> wrote:
- >> for (i=0; i<16; i++)
- >> prom[i] = prom[i+i];
-
- >>The output of the compiler left the loop but removed the
- >>assignment!
-
- >I suspect a proper "volatile" declaration on "prom" might have fixed
- >this, i.e. if "prom" is currently declared "char prom[16]" then it
- >should be declared "volatile char prom[16]". I would not consider
- >this an optimizer bug in Watcom.
-
- HUH? the code as written has a clear effect, which is to shove all of
- the elements of an array over one. It certainly is an optimizer bug.
-
- Read the code carefully; the 2nd reference to prom[] uses a different
- index into the array. This is not a meaningless statement.
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-